#include <htc.h>

/* Program device configuration word
 * Oscillator = External RC Clockout
 * Watchdog Timer = On
 * Power Up Timer = Off
 * Master Clear Enable = External
 * Code Protect = Off
 * Data EE Read Protect = Off
 * Brown Out Detect = BOD and SBOREN disabled
 * Internal External Switch Over Mode = Enabled
 * Monitor Clock Fail-safe = Enabled
 */
//__CONFIG(EXTCLK & WDTEN & PWRTDIS & MCLREN & UNPROTECT & UNPROTECT & BORDIS & IESOEN & FCMEN);
__CONFIG(EXTCLK & WDTDIS & PWRTDIS & MCLREN & UNPROTECT & UNPROTECT & BORDIS & IESOEN & FCMEN);

// Peripheral initialization function
void init(void){
	/***** Common Code ****
	 *  Global interrupt disabled during initialization
	 */
	INTCON	= 0b00000000;
	
	/***** 16F690 Code ****
	 *  Internal oscillator set to 4MHz
	 */
	OSCCON	= 0b01100000;
	
	ANSELH = 0x00;
	//TRISA = 0x01;   //Port A bit 0 set as input
	//TRISB = 0x10;   //Port B bits 7-4 are set as outputs
	TRISB5 = 1;
	TRISC = 0x00;
	
	PORTC = 0x00;
	
	//ei();	// Global interrupts enabled
	di();
	
}
